package org.kca.yarmour.data;

import org.kca.yarmour.yadata.VehicleStatsType;

public class VehicleStats
{
    private String id, name;
    private int maxHull, secSlots, maxSpace, price;
    private String mainGun;
    
    public VehicleStats (String id)
    {
        this.id = id;
    }

    /**
     * @return the name
     */
    public String getName()
    {
        return name;
    }

    /**
     * @return the maxHull
     */
    public int getMaxHull()
    {
        return maxHull;
    }

    /**
     * @return the secSlots
     */
    public int getSecSlots()
    {
        return secSlots;
    }

    /**
     * @return the maxSpace
     */
    public int getMaxSpace()
    {
        return maxSpace;
    }
    
    /**
     * @return the price
     */
    public int getPrice()
    {
        return price;
    }

    /**
     * @return the mainGun
     */
    public String getMainGun()
    {
        return mainGun;
    }

    /**
     * @return the id
     */
    public String getId()
    {
        return id;
    }
    
    /**
     * Creates a vehicle based on vehicle stats specified in XML
     * @param stats the vehicle stats
     * @return a vehicle object
     */
    public static VehicleStats createFromXmlType(VehicleStatsType stats)
    {
        VehicleStats v = new VehicleStats(stats.getId());
        v.name = stats.getName();
        v.maxHull = stats.getHull();
        v.maxSpace = stats.getSpace();
        v.secSlots = stats.getSecslots();
        v.price = stats.getPrice();
        v.mainGun = stats.getMaingun();
        return v;
    }
}
